package com.power.leopard.config;

import java.util.HashMap;
import java.util.Map;

public abstract class AbstractConfigManager implements ConfigManager {

	protected Map<String, Object> localCache = new HashMap<String, Object>();

	public String get(String key, String defaultValue) {
		Object object = localCache.get(key);
		return object == null ? defaultValue : object.toString();
	}

	public int getIntValue(String key, int defaultValue) {
		Object object = localCache.get(key);
		try {
			return Integer.parseInt(object.toString());
		} catch (NumberFormatException e) {
			e.printStackTrace();
		}
		return defaultValue;
	}
	
	public boolean getBooleanValue(String key, boolean defaultValue) {
		return false;
	}

}
